import api from "@/api/index";
export async function loginApi (data){
    let res =await api({url:'/member/login',method:'post',data})
    return res.data
}

export async function regApi(data){
    let res = await api({url:'/member/register',method:'post',data})
    return res.data
}

export async function getUserInfo(data){
    let res = await api({url:'/member/getUserInfo',method:'post',data})
    return res.data
}

export async function getFormList(data){
    let res = await api({url:'/dating/getMyForumList',method:'post',data})
    return res.data
}
//获取所有的用户
export async function getAllUser(data){
    let res = await api({url:'/dating/getUserList',method:'post',data})
    return res.data
}

export async function updateUser(data){
    let res = await api({url:'/member/updateInfo',method:'post',data})
    return res.data
}
//关注会员
export async function followMembers(data){
    let res = await api({url:'/dating/follow',method:'post',params:data})
    return res.data
}


//获取所有的用户
export async function getDatEventList(data){
    let res = await api({url:'/dating/getDatEventList',method:'post',data})
    return res.data
}
//我参与的活动
export async function getMyEventApplicationList(data){
    let res = await api({url:'/dating/getMyEventApplicationList',method:'post',data})
    return res.data
}
export async function getForumList(data){
    let res = await api({url:'/dating/getForumList',method:'post',data})
    return res.data
}
export async function participateInActivities(data){
    let res = await api({url:'/dating/eventApplication',method:'post',data})
    return res.data
}
export async function insertSwearing(data){
    let res = await api({url:'/dating/addSwearing',method:'post',params:data})
    return res.data
}
export async function deleteSwearing(data){
    let res = await api({url:'/dating/deleteSwearing',method:'post',params:data})
    return res.data
}
export async function selectSwearing(data){
    let res = await api({url:'/dating/swearingList',method:'post',data})
    return res.data
}
export async function updateForum(data){
    let res = await api({url:'/dating/editForum',method:'post',data})
    return res.data
}
//获取文章下的评论
export async function getForumComment(data){
    let res = await api({url:'/dating/getForumComment',method:'post',data})
    return res.data
}
//删除文章下的评论
export async function deleteForumComment(data){
    let res = await api({url:'/dating/deleteComment',method:'post',data})
    return res.data
}
//删除文章下的评论
export async function addComment(data){
    let res = await api({url:'/dating/addComment',method:'post',data})
    return res.data
}


export async function insertActivity(data){
    let res = await api({url:'/dating/createEvent',method:'post',data})
    return res.data
}
export async function updateEvent(data){
    let res = await api({url:'/dating/updateEvent',method:'post',data})
    return res.data
}
export async function getEventApplicationList(data){
    let res = await api({url:'/dating/getEventApplicationList',method:'post',data})
    return res.data
}
export async function publishForum(data){
    let res = await api({url:'/dating/publishForum',method:'post',data})
    return res.data
}
export async function unLikeUser(data){
    let res = await api({url:'/dating/follow',method:'post',params:data})
    return res.data
}
export async function getFollowList(data){
    let res = await api({url:'/dating/getFollowList',method:'post',data})
    return res.data
}

//查询聊天历史
export async function selectMessageHistory(data){
    let res = await api({url:'/dating/chatList',method:'post',params:data})
    return res.data
}

//发送消息
export async function sendMessages(data){
    let res = await api({url:'/dating/chat',method:'post',data})
    return res.data
}


export async function uploadFile(data){
    return api({
        url: '/pub/uploadPic',
        method: 'post',
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        data:{file:data.file}
    })
}
